You will need to download raw data from: https://lambrechtslab.sites.vib.be/en/immune-atlas
The page requires login to download data, but any Google account is good. After login, there will be multiple links for downloading. The 2069-Allcells.counts.rds is available in the “Clustering all cells” section. The 2076-OnlineTMEM106B.rds is in the “TMEM106B” section.
data <- readRDS("2076-OnlineTMEM106B.rds")
data@meta.data
obj <- readRDS("2069-Allcells.counts.rds")
meta.data <- data@meta.data[colnames(obj), ]
obj <- CreateSeuratObject(obj, meta.data = meta.data)
obj
An object of class Seurat
33538 features across 65166 samples within 1 assay
Active assay: RNA (33538 features, 0 variable features)
obj$Patient <- stringr::str_match(colnames(obj), "^(.+)_")[, 2]
table(obj$Patient, obj$PatientType)
ICU mild severe Ward
BAL001 0 0 1884 0
BAL002 0 3775 0 0
BAL003 0 2117 0 0
BAL009 0 1212 0 0
BAL010 0 6395 0 0
BAL011 0 448 0 0
BAL012 0 0 498 0
BAL013 0 0 1950 0
BAL014 0 0 1939 0
BAL015 0 0 1989 0
BAL016 0 0 1399 0
BAL017 0 1128 0 0
BAL018 0 504 0 0
BAL019 0 11574 0 0
BAL020 3 0 1405 0
BAL021 0 0 2593 0
BAL022 55 0 1427 0
BAL023 71 0 1153 0
BAL024 0 0 2267 0
BAL025 0 0 1175 0
BAL026 115 0 1996 0
BAL027 40 0 1447 0
BAL028 0 1183 0 0
BAL029 0 1278 0 0
BAL030 0 310 0 0
BAL031 0 0 3795 0
BAL032 0 0 582 0
BAL033 31 0 974 0
BAL034 0 0 1199 0
BAL035 0 0 1144 0
BAL036 0 230 0 0
BAL037 0 896 0 18
BAL038 0 1097 0 0
BAL039 0 0 1017 0
BAL040 10 0 843 0
obj$PatientType2 <- obj$PatientType
obj$PatientType2[obj$PatientType2 == 'ICU'] <- 'severe'
obj$PatientType2[obj$PatientType2 == 'Ward'] <- 'mild'
obj <- NormalizeData(obj, verbose = F)
library(Seurat)
library(cowplot)
library(grid)
library(gridExtra)
library(ggplot2)
library(lattice)
median.stat <- function(x){
out <- quantile(x, probs = c(0.5))
names(out) <- c("ymed")
return(out)
}
median.stat75 <- function(x){
out <- quantile(x, probs = c(0.75))
names(out) <- c("ymed")
return(out)
}
`%ni%`<- Negate(`%in%`)
library(ggpubr)
Warning: 程辑包‘ggpubr’是用R版本4.2.1 来建造的
载入程辑包:‘ggpubr’
The following object is masked from ‘package:cowplot’:
get_legend
goi <- read.table("positive-candidates.txt")$V1
data <- obj[, obj$Domain == 'Epithelial']
data$Domain_disease_patient_type <- paste(data$Domain, data$Disease, data$PatientType2, sep='_')
data$Domain_disease_patient_type <- factor(data$Domain_disease_patient_type,
levels = c("Epithelial_control_mild", "Epithelial_control_severe",
"Epithelial_COVID19_mild", "Epithelial_COVID19_severe"
))
Idents(data) <- 'Domain_disease_patient_type'
# goi <- readxl::read_xlsx("../../../data/Covid19/wauters-cell-research/2021-12-22 Candidate list-COVID.XLSX", sheet = 2)
#cnt = 0
for (g in goi) {
if (g %in% rownames(data)){
png(paste0('positive/', g, '.png'), height = 6, width = 4, units = "in", res = 200)
my_comparisons <- list( c("Epithelial_control_mild", "Epithelial_control_severe"),
c("Epithelial_control_severe", "Epithelial_COVID19_mild"),
c("Epithelial_COVID19_mild", "Epithelial_COVID19_severe"),
c("Epithelial_control_mild", "Epithelial_COVID19_mild"),
c("Epithelial_control_severe", "Epithelial_COVID19_severe"),
c("Epithelial_control_mild", "Epithelial_COVID19_severe"))
feature = g
data2 <- data.frame(label = Idents(data), expression = data@assays$RNA@data[g, ])
ymax = max(data2$expression)
my_comparisons_y <- (c(1.5, 1.05, 1.15, 1.25, 1.4, 1.7) + 0.3) / 1.3
print(
ggplot(data=data2, aes(x = label, y=expression, fill = label)) +
geom_violin() +
geom_point(position = position_jitter(seed = 1, width = 0.2), size = 0.1) + ylim(-0.01, ymax * 1.72) +
stat_summary(fun.y = mean, geom='point', size = 5, colour = "green", shape = 95) +
stat_summary(fun.y = median.stat75, geom='point', size = 5, colour = "red", shape = 95) +
stat_compare_means(comparisons = my_comparisons, label.y = ymax * my_comparisons_y, method = "wilcox.test", size = 4) +
stat_compare_means(label.y = ymax * 1.7, label.x = 1.3, size = 4) +
theme_classic() + theme(legend.position = "none") + ggtitle(g) + theme(axis.text.x = element_text(angle = 45, hjust = 1))
)
dev.off()
} else {
print(paste(g, "not found."))
}
#cnt = cnt + 1
#if (cnt > 5) break
}
Warning: `fun.y` is deprecated. Use `fun` instead.Warning: `fun.y` is deprecated. Use `fun` instead.
library(ggpubr)
goi <- read.table("negative-candidates.txt")$V1
data <- obj[, obj$Domain == 'Epithelial']
data$Domain_disease_patient_type <- paste(data$Domain, data$Disease, data$PatientType2, sep='_')
data$Domain_disease_patient_type <- factor(data$Domain_disease_patient_type,
levels = c("Epithelial_control_mild", "Epithelial_control_severe",
"Epithelial_COVID19_mild", "Epithelial_COVID19_severe"
))
Idents(data) <- 'Domain_disease_patient_type'
for (g in goi) {
if (g %in% rownames(data)){
png(paste0('negative/', g, '.png'), height = 6, width = 4, units = "in", res = 200)
my_comparisons <- list( c("Epithelial_control_mild", "Epithelial_control_severe"),
c("Epithelial_control_severe", "Epithelial_COVID19_mild"),
c("Epithelial_COVID19_mild", "Epithelial_COVID19_severe"),
c("Epithelial_control_mild", "Epithelial_COVID19_mild"),
c("Epithelial_control_severe", "Epithelial_COVID19_severe"),
c("Epithelial_control_mild", "Epithelial_COVID19_severe"))
feature = g
data2 <- data.frame(label = Idents(data), expression = data@assays$RNA@data[g, ])
ymax = max(data2$expression)
my_comparisons_y <- (c(1.5, 1.05, 1.15, 1.25, 1.4, 1.7) + 0.3) / 1.3
print(
ggplot(data=data2, aes(x = label, y=expression, fill = label)) +
geom_violin() +
geom_point(position = position_jitter(seed = 1, width = 0.2), size = 0.1) + ylim(-0.01, ymax * 1.72) +
stat_summary(fun.y = mean, geom='point', size = 5, colour = "green", shape = 95) +
stat_summary(fun.y = median.stat75, geom='point', size = 5, colour = "red", shape = 95) +
stat_compare_means(comparisons = my_comparisons, label.y = ymax * my_comparisons_y, method = "wilcox.test", size = 4) +
stat_compare_means(label.y = ymax * 1.7, label.x = 1.3, size = 4) +
theme_classic() + theme(legend.position = "none") + ggtitle(g) + theme(axis.text.x = element_text(angle = 45, hjust = 1))
)
dev.off()
} else {
print(paste(g, "not found."))
}
#cnt = cnt + 1
#if (cnt > 5) break
}
Warning: `fun.y` is deprecated. Use `fun` instead.Warning: `fun.y` is deprecated. Use `fun` instead.
[1] "RFWD2 not found."
[1] "CCDC101 not found."
[1] "WAPAL not found."
[1] "UFD1L not found."